package com.hns.frame.mybatis;

import java.io.Serializable;

import org.apache.ibatis.session.RowBounds;

/**
 * 翻页属性
 * @author:Fisher
 * @email:zhuangcaijin@126.com
 * @version Revision 2.0.0
 */
public class RowBoundsExt extends RowBounds implements Serializable {
    private static final long serialVersionUID = -3351253244681414298L;
    
    private int               offset           = 0;
    
    private int               limit            = 2147483647;
    
    private int               pageNumber       = 0;
    
    private String            sidx;
    
    private String            sord;
    
    public RowBoundsExt() {
    }
    
    public RowBoundsExt(int pageNumber, int pageSize) {
        this.limit = pageSize;
        this.pageNumber = pageNumber;
        this.offset = ((pageNumber - 1) * pageSize);
    }
    
    public RowBoundsExt(int pageNumber, int pageSize, String sidx, String sord) {
        this.limit = pageSize;
        this.pageNumber = pageNumber;
        this.offset = ((pageNumber - 1) * pageSize);
        this.sidx = sidx;
        this.sord = sord;
    }
    
    public void setOffset(int offset) {
        this.offset = offset;
    }

    public void setLimit(int limit) {
        this.limit = limit;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getLimit() {
        return this.limit;
    }
    
    public int getOffset() {
        return this.offset;
    }
    
    public int getPageNumber() {
        return this.pageNumber;
    }
    
    public String getSidx() {
        return sidx;
    }
    
    public void setSidx(String sidx) {
        this.sidx = sidx;
    }
    
    public String getSord() {
        return sord;
    }
    
    public void setSord(String sord) {
        this.sord = sord;
    }
    
}
